import React,{Component} from "react";
import {withRouter} from "react-router-dom";
import "./index.css"
 class Index extends Component{
	render(){
		let {desc,imgurl,price,title,id} = this.props.data;
		return(
            <li className="productitem" onClick={()=>{this.props.history.push("/detail/"+id)}}>
                <img src={imgurl} alt=""/>
                <p className="name">{title}</p>
                <p className="title">{desc}</p>
                <p className="price">￥<span>{price.toFixed(2)}</span> </p>
            </li>
		)
	}
}

export default withRouter(Index)